how to make array of objects unique in javascript